fix(plugin-oracle): prevent connect crash on malformed handshake packets (#1683)#1685
Merged
Merged
Conversation
Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1683.
Problem
TablePro crashed (
EXC_BREAKPOINT/ Swift trap) on the NIO channel thread when connecting to some Oracle databases. Proven by symbolicating the shippedOracleDriver1.2.11 crash binary (UUID-matched): the trap was insideServerSidePiggyback.decodein OracleNIO, at a non-throwingmoveReaderIndex(forwardBy:). Oracle 12c+ sends a.syncserver-side piggyback during normal session setup; on some servers the packet is shorter than the decoder's fixed skips, so the move ran past the buffer end and trapped. A trap is not catchable by the connection's error handling, so the whole app died on connect.Fix
The fix lives in the OracleNIO fork: TableProApp/oracle-nio#5. This PR bumps the app's
oracle-niopin to that commit and adds the changelog entry.The fork change hardens the connection-handshake decode path so a short or unexpected server packet surfaces a decoding error (or is ignored, for informational piggybacks) instead of trapping:
ServerSidePiggyback.decodeuses throwing buffer moves.fatalErrorin the channel handler is replaced with informational handling.Protocol.decodeFDO parsing is bounds-checked and computed inInt(noUInt8overflow).BackendError.decodebatch indexing is bounds-guarded.ByteBufferUB/SB readers throw or return nil instead of trapping on bad length prefixes.Notes
plugin-oracle-v1.2.12needs to be tagged so the rebuiltOracleDriverreaches users via plugin auto-update.swift test/build is blocked by an Xcode 27 beta toolchain issue in a dependency; the fork CI and an Xcode build validate.